<?php

namespace App\Jobs;

use App\Model\Order;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class OrderCancel implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $user_id;

    protected $order_id;

    /**
     * OrderCancel constructor.
     * @param $user_id
     * @param $order_id
     */
    public function __construct($user_id, $order_id)
    {
        $this->user_id = $user_id;
        $this->order_id = $order_id;
    }


    /**
     * 订单取消任务
     * Execute the job.
     *
     * @return void
     * @throws \Exception
     */
    public function handle()
    {

        try {


            $order = new Order();

            $order->order_cancel($this->user_id, $this->order_id);

        }catch (\Exception $exception){


        }
    }
}
